/**
 * Copyright © 2016, Forp Co., LTD
 *
 * All Rights Reserved.
 */
package org.jeecg.common.datasource.jdbc.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * 分页和排序类
 *
 */
@Setter
@Getter
@ApiModel(value = "PageSort", description = "分页排序信息")
public class PageSort implements Serializable
{
	// 当前页号
	@ApiModelProperty(value = "当前页号")
	private long pageNo = 1;
	
	// 每页记录数：-1 - 不分页，查询所有记录
	@ApiModelProperty(value = "每页记录数")
	private int pageSize = 20;
	
	// 排序字段名称
	@ApiModelProperty(value = "排序字段名称")
	private String column;
	
	// 排序方向
	@ApiModelProperty(value = "排序方向")
	private String order;
	
	// 多排序
	@ApiModelProperty(value = "多列排序方向集合")
	private List<SortField> sort;

	@Setter
	@Getter
	public static class SortField {
		// 排序字段名称
		private String sortName;
		// 排序方向
		private String sortOrder;

		public SortField(String sortName, String sortOrder) {
			this.sortName = sortName;
			this.sortOrder = sortOrder;
		}
	}
}